<?php

/**
 * Targetgroup form base class.
 *
 * @method Targetgroup getObject() Returns the current form's model object
 *
 * @package    symfony
 * @subpackage form
 * @author     Your name here
 */
abstract class BaseTargetgroupForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'idTargetGroup' => new sfWidgetFormInputHidden(),
      'name'          => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'idTargetGroup' => new sfValidatorChoice(array('choices' => array($this->getObject()->getIdtargetgroup()), 'empty_value' => $this->getObject()->getIdtargetgroup(), 'required' => false)),
      'name'          => new sfValidatorString(array('max_length' => 150)),
    ));

    $this->validatorSchema->setPostValidator(
      new sfValidatorPropelUnique(array('model' => 'Targetgroup', 'column' => array('idTargetGroup')))
    );

    $this->widgetSchema->setNameFormat('targetgroup[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Targetgroup';
  }


}
